Exercise

  1. Make a plot of precipitation by year, for each station. There is one station that recorded more than 30000mm of rain in one year. How much rain is this per day? Describe the pattern of precipitation over the years. How will the patterns affect modeling?

30000mm is about 82mm per day. That’s a lot! Its hard to believe this value. Precipitation patterns have been fairly constant at most stations over the years. There appears to be a big uptick in precipitation at a handful of stations in the last 20 years. This means that a linear model for these locations may not be ideal, because rate of change in precipitation is not constant.

  1. Make a histogram and density plot of precipitation. Describe the distribution. Would it be advisable to make a transformation on precipitation before attempting to fit a model? What transformation would you use, if so?

Precipitation is right-skewed. It would make sense to transform it to a log scale for model fitting.

  1. How many years (across all stations) was there no recorded precipitation? Which station had the most zero rain years? Plot the stations that have had zero rain years on the map, coloured by the number of years they had no rain. Is this what you would have expected, given knowledge of Australia’s dry interior and wet east coast? Make a plot of precipitation by year for the stations with the most missings. What is wrong in my code used to prepare the yearly total precipitation by station, that has lead to the zeros. That is, there is good evidence that the zero’s are not “real” zeros but probably missing values. Fix the problem by putting missing values back in for the zeros.

We would expect that stations away from the coast are more likely than others to have the accasional run of dry years. These stations with zero precip are spread all around the country. The stations with a large number of zeros, have big blocks of 0s, eg ASN00007119 has about 34 years in a row of no rain. That’s not feasible. The culprit line of code is

summarise(prcp = mean(prcp, na.rm=T)*365) %>%

If there is any day with 0 rainfall in the year, and many missing values, the average will be returned as zero.

  1. Fit the many models approach to the precipitation records for stations across Australia. Make a summary plot of intercept by slope. Make a plot of \(R^2\) by slope. Are there locations where the models suggest that its getting drier? wetter? What is the most extreme change?

Intercept and slope are almost perfectly related. There are both locations where its getting wetter and drier. The most extreme are wet spots.

  1. Select stations that have good model fits, and plot precipitation by year, with the model overlaid. Show the precipitation by year plots, with model, for stations where its getting wetter, and also those where its getting drier. Explain what you learn.

The increases in precipitation are mostly due to unusual amounts of rain in recent years. The decreases in precipitation are gradual declines.

  1. Make a map with locations coloured by the change in precipitation (slope). How does this compare with the BOM explanation of rainflal patterns?

It pretty much matches what BOM reports. The north west of the country appears to be getting wetter over the period, and the coastlines are getting a little drier.

Plots and calculations

# A tibble: 68 x 2
   station         n
   <chr>       <int>
 1 ASN00007119    35
 2 ASN00003028    24
 3 ASN00005001    23
 4 ASN00040385    21
 5 ASN00005029    18
 6 ASN00004068    17
 7 ASN00004015    16
 8 ASN00004008    14
 9 ASN00010163    14
10 ASN00004046    11
# ... with 58 more rows

# A tibble: 68 x 2
   station         n
   <chr>       <int>
 1 ASN00007119    35
 2 ASN00003028    24
 3 ASN00005001    23
 4 ASN00040385    21
 5 ASN00005029    18
 6 ASN00004068    17
 7 ASN00004015    16
 8 ASN00004008    14
 9 ASN00010163    14
10 ASN00004046    11
# ... with 58 more rows